package com.jfinal.enjoy

/**
 * @author 杜文康
 * @date  2025/8/23 22:04
 */
import com.intellij.codeInsight.AutoPopupController
import com.intellij.codeInsight.editorActions.TypedHandlerDelegate
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile

class EnjoyTypedHandler : TypedHandlerDelegate() {

    override fun checkAutoPopup(
        charTyped: Char,
        project: Project,
        editor: Editor,
        file: PsiFile
    ): Result {
        // 当输入 '#' 时触发自动补全
        if (charTyped == '#') {
            AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null)
        }
        return Result.CONTINUE
    }
}